﻿// Copyright (c) 2014 Jonathan Magnan (http://jonathanmagnan.com/).
// All rights reserved (http://zzzproject.com/sqlbulkcopy-extensions/).
// Licensed under MIT License (MIT) (https://zsqlbulkcopy.codeplex.com/license/).
using System;

namespace Z.Net.Extensions
{
    internal partial class SqlBulkOperation
    {
        /// <summary>
        ///     Query if this object is data source expando object.
        /// </summary>
        /// <returns>true if data source expando object, false if not.</returns>
        public bool IsDataSourceExpandoObject()
        {
            Type type = DataSource.GetType();
            if (type.IsGenericType)
            {
                string typeName = type.GetGenericArguments()[0].FullName;
                if (typeName == "System.Object")
                {
                    return true;
                }
            }

            return false;
        }
    }
}